package org.eclipse.swt.snippets;

public class LevelFilter implements Filter {

    private Level l;

    public LevelFilter(Level l) {
        this.l = l;
    }

    @Override
    public boolean filter(Message msg) {
        return l == msg.getLevel();
    }

    @Override
    public int hashCode() {
        int hashCode = l.hashCode();
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof LevelFilter) {
            LevelFilter f = (LevelFilter) obj;
            return l == f.l;
        }
        return false;
    }
}
